<?php

namespace App\Providers;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //打印sql
        /*DB::connection('qpAccounts')->listen(function ($query) {
            var_dump($query->sql);
        });*/
        view()->composer('*', function ($view)
        {
            $view->with('user_info', json_decode(session('user_info') , true));
            $view->with('user_menus', json_decode(session('user_menus') , true));
            $view->with('pageSize', config('constant.pageSize'));
        });
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
